<template>
  <el-container>
    <el-header>
      <el-row>
        <el-col :span="14">
          <img src="@/assets/logo.png" style="width: 40px; padding-top:10px; padding-left:20px;">
        </el-col>
        <el-col :span="10" class="align-right">
          <el-button @click="$router.push({ path: '/' })">回首页</el-button>
          <el-button @click="$router.push({ path: '/about' })">关于</el-button>
        </el-col>
      </el-row>
    </el-header>
    <el-container class="content-v">
      <el-aside class="aside">
        <el-menu
          :default-active="menuActive"
          :uniqueOpened="true"
          style="border: 0"
          background-color="#545c64"
          text-color="#fff"
          :router="true"
          active-text-color="#ffd04b">
          <el-menu-item index="/app/dash"><i class="el-icon-house"/>处理中心</el-menu-item>
          <el-submenu index="baseConfig">
            <template #title>
              <i class="el-icon-s-operation"></i>
              <span>引擎参数配置</span>
            </template>
            <el-menu-item-group>
              <template #title>基础配置</template>
              <el-menu-item index="/app/baseDatasourceConfig">
                <i class="el-icon-s-data"></i>
                数据源
              </el-menu-item>
              <el-menu-item index="/app/baseFetcherConfig">
                <i class="el-icon-c-scale-to-original"/>
                数据提取 fetcher
              </el-menu-item>
              <el-menu-item index="/app/baseRulesParamConfig">
                <i class="el-icon-collection-tag"/>
                规则参数
              </el-menu-item>
              <el-menu-item index="/app/baseRuleConfig">
                <i class="el-icon-present"/>
                规则配置
              </el-menu-item>
              <el-menu-item index="/app/baseRulesEngineConfig">
                <i class="el-icon-box"/>规则引擎配置
              </el-menu-item>
              <el-menu-item index="/app/baseBucketConfig">
                <i class="el-icon-aim"/>流量分桶配置
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="monitor">
            <template #title><i class="el-icon-monitor"></i>监控</template>
            <el-menu-item index="/app/monitor/visitTimesMonitor">
              <i class="el-icon-data-analysis"></i>调用次数统计
            </el-menu-item>
          </el-submenu>
        </el-menu>
        <div class="footer">&copy; 2021 - {{ currentYear }}</div>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      currentYear: new Date().getFullYear()
    }
  },
  computed: {
    menuActive() {
      return this.$route.path
    },
    isLogin() {
      return true
    }
  }
}
</script>

<style scoped>
.el-header {
  height: 60px;
  background-color: white;
  line-height: 60px;
}

.footer {
  text-align: center;
  line-height: 60px;
  width: 200px;
  background-color: #545c64;
  color: #fecf57;
  clear: both;
  position: absolute;
  margin-top: -60px;
  bottom: 0px;
}

.aside {
  width: 200px !important;
  height: 100% !important;
  background-color: #545c64;
}

.el-container {
  height: 100%;
}

.el-header {
  height: 60px;
  background-color: white;
  line-height: 60px;
}

.el-header > span,
.el-header .el-dropdown {
  font-size: 18px;
}

.el-main {
  text-align: left;
  color: #333;
}
</style>
